<template>
  <div>
    <div>
      <h2 class="title"><span class="green">#</span> {{}} v-text v-html</h2>

      <h1>{{ msg }}</h1>
      <div v-text="text"></div>
      <div v-html="text"></div>
      <div v-bind:title="title" v-bind:class="[{ 'active': isActive }, 'title',errorClass]">hello world</div>
      <input type="text" v-model="title">
    </div>

  </div>
</template>

<script>
  import $ from 'jquery';

  export default {

    data() {
      return {
        msg: 'Welcome to Your Vue.js App',
        text: '<div style="color: red">I am red</div>',
        title: '大冰的畅销书',
        isActive:true,
        errorClass: 'text-danger'
      }
    },
    mounted() {
      // $('.js-button').click(function(e) {
      //   let index = $(e.target).index();
      //   let answerText = '';
      //   index ? (answerText = '你怕是个假猩猩吧') : (answerText = 'bingo！平行线没有相交（香蕉）');
      //   $('.js-answer').text(answerText);
      //   $(this).addClass('active').siblings().removeClass('active');
      // });
    },

    methods: {

    }
  }

</script>

<style scope>
  .title {
    width: 25%;
    margin: 0 auto;
    margin-bottom: 40px;
    border-bottom: 1px dashed #999;
  }

  .green {
    color: green;
  }

  .btn-answer {
    cursor: pointer;
    margin-right: 20px;
    margin-bottom: 20px;
    padding: 4px 10px;
    font-size: 20px;
    border-radius: 4px;
  }

  .active {
    outline: none;
    background-color: #b5ebff;
  }

</style>
